
subjectList = {...
    'N072912R'...
    'A080512A'...
    'R091412V'...
    'M101012R'...
    };

%    'K091412S'...
    
ADAPT_t_thresh = 1.65;
analysesDir = '/Volumes/cluster/jet/mattar/AdaptID/Analyses/';
FFAcontrast = 2; %1 for Faces-Objects, 2 for Faces-Scenes

numSubjects = length(subjectList);

adaptationCurve = zeros(numSubjects,6);
std_adaptationCurve = zeros(numSubjects,6);

for subjIndx = 1:numSubjects
    [averageBetas maskedBetas averageBetasMatrix stdBetasMatrix] = extractROImask(subjectList{subjIndx}, ADAPT_t_thresh, FFAcontrast, analysesDir);
    adaptationCurve(subjIndx,:) = nanmean(averageBetasMatrix);
    std_adaptationCurve(subjIndx,:) = nanstd(averageBetasMatrix);
end

%errorbar(adaptationCurve',std_adaptationCurve')
plot(adaptationCurve');
legend(subjectList{1}, subjectList{2}, subjectList{3}, subjectList{4})
ylabel('Beta value')
xlabel('Steps back')
axis([1 6 -20 20]);
set(gca,'XTick',[1:6]);
hline = refline(0,0);
set(hline,'Color','red');
set(hline,'LineStyle','--');